package demo1;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
@WebServlet("/hello")
public class HelloServer extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //下面的这个就是打印在我们饿服务器的终端上面1
        System.out.println("hello world");

        //下面的这个就是显示在我们的这个浏览器的页面上
        resp.getWriter().write("hello world");
    }
}
